home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / Snippets / Platforms & Tools / MacApp / AEGestalt 1.0b3 / ULabelView.cp < prev    next >
Encoding:
Text File  |  1991-12-11  |  2.3 KB  |  71 lines  |  [TEXT/MPS ]

  1. //     ULabelView.cp 
  2. //     Copyright © 1991 by Apple Computer, Inc. All rights reserved.
  3. //    Kent Sandvik DTS
  4. //    This file contains all the member functions for TLabelView, i.e.
  5. //    it handles the drawing of the TLabelView view.
  6.  
  7.  
  8. #ifndef __LABELVIEW__  
  9. #include "ULabelView.h" 
  10. #endif
  11.  
  12. //    Empty constructor - for avoiding ptabs in global data space
  13. #pragma segment ARes
  14. TLabelView::TLabelView() {}
  15.  
  16.  
  17. #pragma segment AInit
  18. pascal void TLabelView::Initialize()
  19. {
  20.     inherited::Initialize();
  21.     
  22. //    create all the label strings, yes, this would be far better if we
  23. //    loaded them in from STR# resources, and maybe we will do this in the
  24. //    next improved version (and charge $99 for the 1.1 release)
  25.  
  26.     fLabel1     = "• Machine type:";
  27.     fLabel2     = "• System Version:";
  28.     fLabel3         = "• Processor Type:";
  29.     fLabel4     = "• Has FPU?";
  30.     fLabel5     = "• Has Color Quickdraw?";
  31.     fLabel6     = "• Has 32-bit Quickdraw?";
  32.     fLabel7     = "• Has SCSI?";
  33.     fLabel8     = "• Has Apple Event Mgr?";
  34.     fLabel9     = "• Has EditionMgr?";
  35.     fLabel10     = "• Is A/UX system?";
  36.     fLabel11    = "• Has TrueType?";
  37.     fLabel12    = "• AppleTalk driver no:";
  38. }
  39.  
  40.  
  41. #pragma segment ARes
  42. pascal void TLabelView::Draw(const VRect& area)
  43. {    
  44.     inherited::Draw(area);
  45.     this->DrawLabels();    
  46. }
  47.  
  48.  
  49. #pragma segment ARes
  50. pascal void TLabelView::DrawLabels()
  51. {
  52.     // Set font and font size
  53.     PenNormal(); TextFont(geneva); TextSize(9);
  54.     
  55.     // Draw Labels
  56.     MoveTo(kHorizontStart, kVerticalStart);                     DrawString(fLabel1);
  57.     MoveTo(kHorizontStart, kVerticalStart + kVerticalOffset);     DrawString(fLabel2);
  58.     MoveTo(kHorizontStart, kVerticalStart + 2*kVerticalOffset);    DrawString(fLabel3);
  59.     MoveTo(kHorizontStart, kVerticalStart + 3*kVerticalOffset);    DrawString(fLabel4);
  60.     MoveTo(kHorizontStart, kVerticalStart + 4*kVerticalOffset);    DrawString(fLabel5);
  61.     MoveTo(kHorizontStart, kVerticalStart + 5*kVerticalOffset);    DrawString(fLabel6);
  62.     MoveTo(kHorizontStart, kVerticalStart + 6*kVerticalOffset);    DrawString(fLabel7);
  63.     MoveTo(kHorizontStart, kVerticalStart + 7*kVerticalOffset);    DrawString(fLabel8);
  64.     MoveTo(kHorizontStart, kVerticalStart + 8*kVerticalOffset);    DrawString(fLabel9);
  65.     MoveTo(kHorizontStart, kVerticalStart + 9*kVerticalOffset);    DrawString(fLabel10);
  66.     MoveTo(kHorizontStart, kVerticalStart + 10*kVerticalOffset);DrawString(fLabel11);
  67.     MoveTo(kHorizontStart, kVerticalStart + 11*kVerticalOffset);DrawString(fLabel12);
  68.     
  69.     PenNormal();
  70. }
  71.